package java1;

import java.util.Scanner;
import java.util.TreeSet;

public class Fivetwo {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		TreeSet<String> str=new TreeSet<String>();
		while(sc.hasNext()){
			String a=sc.next();
			if(a.equals("!!!!!")) break;
			str.add(a);
		}
		System.out.println(str.size());	
		Object[] arr = str.toArray();
		for(int i=0;i<10;i++){
			System.out.println(arr[i]);
		}
	}
	

}